import postApi from '../../utils/http/api'
import postApiNew from '../../utils/http/api-new'
import postApiNewUnLogged from '../../utils/http/api-new-unlogged'

export default {

  //通过微信Code获取微信OpenId
  getOpenId (code) {
    return postApiNewUnLogged({
      actionCode: 'weixinchange',
      path: '/new/authorize',
      requestData: {
        weixinCode: code
      }
    })
  },

  //通过微信Code获取微信unionId  pc端
  getPcUnionId (code) {
    return postApiNewUnLogged({
      actionCode: 'weixinchange',
      path: '/new/pcauthorize',
      requestData: {
        weixinCode: code
      }
    })
  },


  //下单
  addOrder (data) {
    return postApiNew({
      actionCode: 'zhiye-mobile',
      path: '/order/addOrder',
      requestData: data
    })
  },
  addXieLiPlanOrderByTsId(data){
    return postApi({
      actionCode: '100543',
      method: 'addXieLiPlanOrderByTsId',
      requestData: data,
    })
  },
  //订单验证
  orderConfirm(prepayid) {
    return postApi({
      actionCode: '800100',
      method: 'getOrderStatus',
      requestData: {
        prepayid: prepayid
      },
    })
  },
  //是否购买过会员
  isPurchasedVIP(data){
    return postApi({
      actionCode: '100543',
      method: 'addXieLiPlanOrderByTsId',
      requestData: data,
    })
  }

}
